<template>
  <!--财务信息 -->
  <div style="height:520px">
    <FormPanel
      ref="infoFinance"
      :list="initForm"
      :cols="3"
      :labelWidth="140"
      :formType="value.type"
      :isSubmitBtn="false"
      @formChange="formChangeHandle"
    />
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
export default {
  mixins: [dictionary],
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      initForm: this.initFormFun(),
      formValue: {}
    };
  },
  mounted() {
    console.log(this.value); //获取到行id 、类型（新增、详情）
    //请求接口进行赋值，自己写吧
  },
  methods: {
    //初始化数据
    init(data) {
      this.formValue = {};
      // if (data.type === 'edit') {
      //   this.initForm.forEach(x => {
      //     x.initialValue = data.row[x.fieldName];
      //   });
      // }
    },
    //搜索数据
    initFormFun() {
      return [
        {
          type: 'INPUT',
          label: '开户银行名称',
          fieldName: 'field1',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '开户行行号',
          fieldName: 'field2',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '银行账号',
          fieldName: 'field3',
          initialValue: ''
        },
        
        {
          type: 'INPUT',
          label: '邮编',
          fieldName: 'field5',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '开票电话',
          fieldName: 'field6',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '财务负责人电话',
          fieldName: 'field7',
          initialValue: ''
        },{
          type: 'UPLOAD_IMG',
          label: '开户证明附件',
          fieldName: 'UPLOAD_IMG',
          upload : {
            actionUrl:'',//上传的地址
            fixedSize:[300,500], //剪裁尺寸
            isCalcHeight:false,
            limit:1 //上传数量
          },
          initialValue: ['https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/home/img/qrcode/zbios_09b6296.png'],
          disabled:true,
        },
        {
          type: 'TEXT_AREA',
          label: '发票邮寄地址',
          rows:2,
          maxlength:100,
          fieldName: 'field9',
          initialValue: ''
        },{
          type: 'INPUT',
          label: '发票邮寄收件人',
          fieldName: 'field8',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '发票邮寄收件电话',
          fieldName: 'field10',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '紧急联系人',
          fieldName: 'field11',
          initialValue: ''
        },
        {
          type: 'INPUT',
          label: '紧急联系电话',
          fieldName: 'field12',
          initialValue: ''
        }
      ];
    },
    formChangeHandle(val) {
      this.formValue = val;
    }
  }
};
</script>